package com.eugeneMa.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 课时表
 *
 * @author Eugenema
 * @date 2022/3/31 15:53
 */
public class ClassTime {
    /** 课时表ID */
    private Integer id;
    /** 课时表名称，默认为：无名课时表 */
    private String designation;
    /** 所属用户ID */
    private Integer userId;
    /** 权限设置，[1 默认]仅限自己使用  [2]可供所有人使用 */
    private Integer auth;
    /** 上课铃声 */
    private Integer goBellId;
    /** 下课铃声 */
    private Integer afterBellId;
    /** 预备铃声 */
    private Integer readyBellId;
    /** 开始时间 */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    /** 上午课时数 */
    private Integer forenoonNum;
    /** 下午课时数 */
    private Integer afternoonNum;
    /** 午休时长，单位：分钟 */
    private Integer noonBreakMinutes;
    /** 学习时长，单位：分钟 */
    private Integer learnMinutes;
    /** 休息时长，单位：分钟 */
    private Integer restMinutes;
    /** 大课间开启标志，[1]开启  [2 默认]不开启 */
    private Integer bigBreak;
    /** 预备铃开启标志，[1]开启  [2 默认]不开启 */
    private Integer readyBell;

    /** 虚拟字段：总课时数 */
    private Integer classNum;
    /** 虚拟字段：描述字段长度 */
    private Integer designationLength = 15;

    public ClassTime() {
    }

    public ClassTime(Integer id, String designation, Integer userId, Integer auth, Integer goBellId, Integer afterBellId, Integer readyBellId, Date startTime, Integer forenoonNum, Integer afternoonNum, Integer noonBreakMinutes, Integer learnMinutes, Integer restMinutes, Integer bigBreak, Integer readyBell) {
        this.id = id;
        this.designation = designation;
        this.userId = userId;
        this.auth = auth;
        this.goBellId = goBellId;
        this.afterBellId = afterBellId;
        this.readyBellId = readyBellId;
        this.startTime = startTime;
        this.forenoonNum = forenoonNum;
        this.afternoonNum = afternoonNum;
        this.noonBreakMinutes = noonBreakMinutes;
        this.learnMinutes = learnMinutes;
        this.restMinutes = restMinutes;
        this.bigBreak = bigBreak;
        this.readyBell = readyBell;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getAuth() {
        return auth;
    }

    public void setAuth(Integer auth) {
        this.auth = auth;
    }

    public Integer getGoBellId() {
        return goBellId;
    }

    public void setGoBellId(Integer goBellId) {
        this.goBellId = goBellId;
    }

    public Integer getAfterBellId() {
        return afterBellId;
    }

    public void setAfterBellId(Integer afterBellId) {
        this.afterBellId = afterBellId;
    }

    public Integer getReadyBellId() {
        return readyBellId;
    }

    public void setReadyBellId(Integer readyBellId) {
        this.readyBellId = readyBellId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Integer getForenoonNum() {
        return forenoonNum;
    }

    public void setForenoonNum(Integer forenoonNum) {
        this.forenoonNum = forenoonNum;
    }

    public Integer getAfternoonNum() {
        return afternoonNum;
    }

    public void setAfternoonNum(Integer afternoonNum) {
        this.afternoonNum = afternoonNum;
    }

    public Integer getNoonBreakMinutes() {
        return noonBreakMinutes;
    }

    public void setNoonBreakMinutes(Integer noonBreakMinutes) {
        this.noonBreakMinutes = noonBreakMinutes;
    }

    public Integer getLearnMinutes() {
        return learnMinutes;
    }

    public void setLearnMinutes(Integer learnMinutes) {
        this.learnMinutes = learnMinutes;
    }

    public Integer getRestMinutes() {
        return restMinutes;
    }

    public void setRestMinutes(Integer restMinutes) {
        this.restMinutes = restMinutes;
    }

    public Integer getBigBreak() {
        return bigBreak;
    }

    public void setBigBreak(Integer bigBreak) {
        this.bigBreak = bigBreak;
    }

    public Integer getReadyBell() {
        return readyBell;
    }

    public void setReadyBell(Integer readyBell) {
        this.readyBell = readyBell;
    }

    public Integer getClassNum() {
        return (forenoonNum == null ? 0 : forenoonNum) + (afternoonNum == null ? 0 : afternoonNum);
    }

    public Integer getDesignationLength() {
        return designationLength;
    }

}
